package service

import (
	"context"

	"algo-sdk-go/project/matchmaking/application/dto"
	"algo-sdk-go/project/matchmaking/domain/models/entity"
	domainService "algo-sdk-go/project/matchmaking/domain/service"
)

type MatchService struct {
	matchMakingDomain *domainService.MatchMakingDomain
}

func NewMatchService(matchMakingDomain *domainService.MatchMakingDomain) *MatchService {
	return &MatchService{
		matchMakingDomain: matchMakingDomain,
	}
}

func (m *MatchService) Match(ctx context.Context, userNum int) ([]dto.UserAllInfo, error) {
	return m.matchMakingDomain.UserMapping(ctx, userNum)
}

func (m *MatchService) Recommend(ctx context.Context) ([]entity.UserProfile, error) {
	return m.matchMakingDomain.RecommendUser(ctx)
}

func (m *MatchService) SyncRecommend(ctx context.Context, recommendUserIds []int) error {
	return m.matchMakingDomain.SetNearestRecommendUser(ctx, recommendUserIds)
}
